package com.liuzh.kaoyanspringboot.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import java.util.List;

import lombok.Getter;
import lombok.Setter;

/**
 * <p>
 * 评论
 * </p>
 *
 * @author 刘志鸿
 * @since 2023-03-11
 */
@Getter
@Setter
  public class Comment implements Serializable {

    private static final long serialVersionUID = 1L;

      /**
     * id
     */
        @TableId(value = "id", type = IdType.AUTO)
      private Integer id;

      /**
     * 内容
     */
      private String content;

      /**
     * 评论人id
     */
      private Integer userId;

      /**
     * 评论时间
     */
      private String time;

      /**
     * 父id
     */
      private Integer pid;

      /**
     * 最上级id
     */
      private Integer orginId;

      /**
     * 关联文章id
     */
      private Integer articleId;

      private Integer like;

      @TableField(exist = false)
      private String nickname;
      @TableField(exist = false)
      private String avatarUrl;
      @TableField(exist = false)
      private String pNickname;
      @TableField(exist = false)
      private Integer pUserId;
      @TableField(exist = false)
      private String pAvatarUrl;
      @TableField(exist = false)
      private List<Comment> children;

  @Override
  public String toString() {
    return "Comment{" +
            "id=" + id +
            ", content='" + content + '\'' +
            ", userId=" + userId +
            ", time='" + time + '\'' +
            ", pid=" + pid +
            ", orginId=" + orginId +
            ", articleId=" + articleId +
            ", like=" + like +
            ", nickname='" + nickname + '\'' +
            ", avatarUrl='" + avatarUrl + '\'' +
            ", pNickname='" + pNickname + '\'' +
            ", pUserId=" + pUserId +
            ", pAvatarUrl='" + pAvatarUrl + '\'' +
            ", children=" + children +
            '}';
  }
}
